home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12265 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.spies.com!usenet
  2. From: Erik Max Francis <max@alcyone.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: [Q] Reading Text From File
  5. Date: Fri, 29 Mar 1996 14:42:12 -0800
  6. Organization: Alcyone Systems
  7. Message-ID: <315C6744.32A724CC@alcyone.com>
  8. References: <4jf6qa$ng@preeda.internex.net.au>
  9. NNTP-Posting-Host: newton.alcyone.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
  14.  
  15. Quenten Barber wrote:
  16.  
  17. >     I run a small 1 line BBS and am looking to make my own 'Last Callers'
  18. > door thing, So I looked up the Structure for Remote Access's files and
  19. > found it was all done in Pascal.... so I've tried to convert it to C
  20. > and i eventually go it to read in the files fine, untill I put a different
  21. > "Lastcall.bbs" file in there then it missed bits and the names wouldn't come
  22. > out right, I presume that there isn't any inconsistancys (excuse my spelling)
  23. > with RA as I looked at the files with a Hex Editor and found that all of
  24. > the strings started at the same offset, so why dosn't my program read them
  25. > in the same way ??
  26.  
  27. Likely your problem is that C packs structures differently than Pascal packs
  28. records.  Basically there's no reliable (meaaning portable) way to get around
  29. this.  What you should do is read the Pascal record size in as a block and then
  30. pick out the bits and pieces that you want individually.  (Also, strings will
  31. be Pascal strings, not C strings.)
  32.  
  33. -- 
  34. Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
  35. San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
  36. H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
  37. Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
  38. "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
  39.